const mongoose = require('mongoose');

mongoose.connect('mongodb+srv://yao040702:OqpicoE2qRDPqLrg@cluster0.yixdysv.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0')

let db=mongoose.connection

db.on('open',()=>{
    console.log('connected to db')
})

db.on('error',(err)=>{
    console.log(err)
})

module.exports=mongoose